<template>
  <el-input-number
    :readonly="service.readonly"
    :disabled="ui.disabled"
    :precision="ui.precision"
    :step="ui.step"
    :size="ui.size"
    :controls="ui.controls"
    :controls-position="ui.controlsPosition || ''"
    :min="ui.min"
    :max="ui.max"
    :modelValue="val"
    @update:model-value="updateValue"
  />
</template>

<script lang="ts" setup name="lc-sf-textarea">
import { computed, inject } from "vue";
import { InputNumberUI } from "../interface";
import { SFService } from "../sf.service";
import { TItemOption } from "../type";
const props = defineProps<TItemOption<InputNumberUI>>();
const sf = inject<SFService>("sf-service");
const val = computed(() => {
  return sf.getVaule(props.keyPath);
});
const ui = props.service.getUI<InputNumberUI>();
const updateValue = (val: number) => {
  if (ui.change) {
    ui.change(val);
  }
  sf.setVaule(props.keyPath, val);
};
</script>

<style></style>
../types
